<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let emp = {name:"张三",salay:5000,job:"销售"}

    console.log(emp.name);
    console.log(emp.salay);
    console.log(emp.job);

    //封装几个商品信息
    let arr = [{title:"苹果手机",price:"3000",num:55},{title:"小米手机",price:"5000",num:550},{title:"华为手机",price:"8000",num:2-55}]

    for(let item of arr){
        let o = document.createElement("p");
        p.innerText = item.title+"价格:"+item.price+"库存:"+item.num;
        document.body.append(p);
    }
</script>
</body>
</html>